package com.darkplanet.management.controller;

import com.darkplanet.management.dao.IProjectDao;
import com.darkplanet.management.dao.IProjectDaoImpl;
import com.darkplanet.management.service.RequirementService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/ProjectneedaddServlet")
public class ProjectneedaddServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String project_id = request.getParameter("project_id");
        System.out.println(project_id);
        int i = Integer.parseInt(project_id);
        System.out.println(i);
        String title = request.getParameter("title");
        String simple_desc = request.getParameter("simple_desc");
        String complex_desc = request.getParameter("complex_desc");
        String remark = request.getParameter("remark");
        final RequirementService requirementService = new RequirementService();
        requirementService.add( i , title , simple_desc , complex_desc , remark );
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request, response);
    }
}
